package com.hejing.面向对象特征之二_继承.初识继承;

/**
 * ClassName: ManKidn
 * Package: com.hejing.面向对象特征之二_继承
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-03-25 20:10
 * @Version: 1.0
 */
public class ManKind {
    private int sex;
    private int salary;

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    // 构造器:

    public ManKind() {
    }

    public ManKind(int sex, int salary) {
        this.sex = sex;
        this.salary = salary;
    }

    // 方法:
    public void manOrWoman() {
        if (sex == 1) {
            System.out.println("this is man");
        } else {
            System.out.println("this is woman");
        }
    }

    public void employeed() {
        if(salary == 0) {
            System.out.println("no job");
        } else {
            System.out.println("have job");
        }
    }
}



















